<?php
include './inc.php';
header('content-type:text/html;charset=utf-8');
echo '<pre>';



//$incs = get_included_files();
//var_export($incs);
//
//exit;



//require $app_sdk.'qqmb/inc.php';
//
//var_export(get_included_files());
//echo "\n\n";
//
//$p = array(
//		'u' => 'http://v.youku.com/v_playlist/f6098954o1p0.html'
//	);
//$ret = $c->getVideo($p);
//$c->printArr($ret);





//$video_url = 'http://v.qq.com/cover/p/phy570o6slympvb.html?vid=8KBAmweEKQl';
//$video_url = 'http://v.ku6.com/fetchVideo4Player/3WnCo_I4PdH-IzpQ.html';
//$video_url = 'http://v.youku.com/v_show/id_XMjI4MDM4NDc2.html';
//$video_url = 'vid=8KBAmweEKQl';
//$info = MbVideo::getVideoInfo($video_url);
//var_export($info);

$mb = new MicroBlog();
$data = array(
	'type'	=> 1,
	'uid'	=> 1,
	'nickname'	=> 'test',
	'isauth'	=> 1,
	'content'	=> 'ttttttttt',
	'post_time'	=> time(),
	'ip'		=> Ip::getIntIp(),
	'pic'		=> '',
	'audio'		=> '',
	'video'		=> '',
);
$mb->addBlog($data);
//$list = $mb->getList();
//var_export($list);
//var_export(json_decode($list[0]['video'], true));

//
//echo json_encode($info);
//exit;






























$data = array(
	'type'		=> 1,
	'uid'		=> 1,
	'nickname'	=> 'Joseph',
	'isauth'	=> 1,
	'content'	=> 'test and test againhttp://www.pin5i.com/show_topic-25932.html?test=&test=3#ab cf汉字'
				.'新闻感想https://www.qq.com测试还有很长很长的字符串...............................'
				.'...............',
	'post_time'	=> time(),
	'ip'		=> Ip::getIntIp(),
	'pic'		=> '',
	'audio'		=> '',
	'video_url'	=> 'http://v.youku.com/v_show/id_XMjI4MDM4NDc2.html',
	'state'		=> 0,
	'open_name'	=> '',
	'open_bid'	=> '',
	'open_nickname'	=> '',
);
$mb = new MicroBlog();
$mb->addBlog($data);
//$list = $mb->getList(array('has_pages'=>1));
//var_export($list);
//var_export($mb->errors());



$s = '2342342.2';
$s = 2342;
$start = microtime(1);
for ($i=0; $i<10000; $i++) {
	$app_root = dirname(dirname(__FILE__)).'/';
}
echo microtime(1) - $start;
echo "\n\n";

$start = microtime(1);
for ($i=0; $i<10000; $i++) {
	$app_root = substr(__FILE__, 0, strrpos(__FILE__, DIRECTORY_SEPARATOR, -10)).'/';
}
echo microtime(1) - $start;
echo "\n\n";
